\(\int \sec ^6(c+d x) (a+b \tan ^2(c+d x))^2 \, dx\) [444]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 96 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {a^2 \tan (c+d x)}{d}+\frac {2 a (a+b) \tan ^3(c+d x)}{3 d}+\frac {\left (a^2+4 a b+b^2\right ) \tan ^5(c+d x)}{5 d}+\frac {2 b (a+b) \tan ^7(c+d x)}{7 d}+\frac {b^2 \tan ^9(c+d x)}{9 d} \]

[Out]

a^2*tan(d*x+c)/d+2/3*a*(a+b)*tan(d*x+c)^3/d+1/5*(a^2+4*a*b+b^2)*tan(d*x+c)^5/d+2/7*b*(a+b)*tan(d*x+c)^7/d+1/9*
b^2*tan(d*x+c)^9/d

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3756, 380} \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {\left (a^2+4 a b+b^2\right ) \tan ^5(c+d x)}{5 d}+\frac {a^2 \tan (c+d x)}{d}+\frac {2 b (a+b) \tan ^7(c+d x)}{7 d}+\frac {2 a (a+b) \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan ^9(c+d x)}{9 d} \]

[In]

Int[Sec[c + d*x]^6*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

(a^2*Tan[c + d*x])/d + (2*a*(a + b)*Tan[c + d*x]^3)/(3*d) + ((a^2 + 4*a*b + b^2)*Tan[c + d*x]^5)/(5*d) + (2*b*
(a + b)*Tan[c + d*x]^7)/(7*d) + (b^2*Tan[c + d*x]^9)/(9*d)

Rule 380

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n
)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]

Rule 3756

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (1+x^2\right )^2 \left (a+b x^2\right )^2 \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (a^2+2 a (a+b) x^2+\left (a^2+4 a b+b^2\right ) x^4+2 b (a+b) x^6+b^2 x^8\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {a^2 \tan (c+d x)}{d}+\frac {2 a (a+b) \tan ^3(c+d x)}{3 d}+\frac {\left (a^2+4 a b+b^2\right ) \tan ^5(c+d x)}{5 d}+\frac {2 b (a+b) \tan ^7(c+d x)}{7 d}+\frac {b^2 \tan ^9(c+d x)}{9 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.53 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.10 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {\left (8 \left (21 a^2-6 a b+b^2\right )+4 \left (21 a^2-6 a b+b^2\right ) \sec ^2(c+d x)+3 \left (21 a^2-6 a b+b^2\right ) \sec ^4(c+d x)+10 (9 a-5 b) b \sec ^6(c+d x)+35 b^2 \sec ^8(c+d x)\right ) \tan (c+d x)}{315 d} \]

[In]

Integrate[Sec[c + d*x]^6*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

((8*(21*a^2 - 6*a*b + b^2) + 4*(21*a^2 - 6*a*b + b^2)*Sec[c + d*x]^2 + 3*(21*a^2 - 6*a*b + b^2)*Sec[c + d*x]^4
 + 10*(9*a - 5*b)*b*Sec[c + d*x]^6 + 35*b^2*Sec[c + d*x]^8)*Tan[c + d*x])/(315*d)

Maple [A] (verified)

Time = 11.66 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.64

method result size
derivativedivides \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{9 \cos \left (d x +c \right )^{9}}+\frac {4 \sin \left (d x +c \right )^{5}}{63 \cos \left (d x +c \right )^{7}}+\frac {8 \sin \left (d x +c \right )^{5}}{315 \cos \left (d x +c \right )^{5}}\right )+2 a b \left (\frac {\sin \left (d x +c \right )^{3}}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \sin \left (d x +c \right )^{3}}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \sin \left (d x +c \right )^{3}}{105 \cos \left (d x +c \right )^{3}}\right )-a^{2} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(157\)
default \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{9 \cos \left (d x +c \right )^{9}}+\frac {4 \sin \left (d x +c \right )^{5}}{63 \cos \left (d x +c \right )^{7}}+\frac {8 \sin \left (d x +c \right )^{5}}{315 \cos \left (d x +c \right )^{5}}\right )+2 a b \left (\frac {\sin \left (d x +c \right )^{3}}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \sin \left (d x +c \right )^{3}}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \sin \left (d x +c \right )^{3}}{105 \cos \left (d x +c \right )^{3}}\right )-a^{2} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(157\)
risch \(\frac {16 i \left (210 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}-420 a b \,{\mathrm e}^{12 i \left (d x +c \right )}+210 b^{2} {\mathrm e}^{12 i \left (d x +c \right )}+945 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}-630 a b \,{\mathrm e}^{10 i \left (d x +c \right )}-315 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+1701 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-126 a b \,{\mathrm e}^{8 i \left (d x +c \right )}+441 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+1554 \,{\mathrm e}^{6 i \left (d x +c \right )} a^{2}-84 a b \,{\mathrm e}^{6 i \left (d x +c \right )}-126 \,{\mathrm e}^{6 i \left (d x +c \right )} b^{2}+756 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-216 a b \,{\mathrm e}^{4 i \left (d x +c \right )}+36 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+189 \,{\mathrm e}^{2 i \left (d x +c \right )} a^{2}-54 a b \,{\mathrm e}^{2 i \left (d x +c \right )}+9 \,{\mathrm e}^{2 i \left (d x +c \right )} b^{2}+21 a^{2}-6 a b +b^{2}\right )}{315 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{9}}\) \(279\)

[In]

int(sec(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(b^2*(1/9*sin(d*x+c)^5/cos(d*x+c)^9+4/63*sin(d*x+c)^5/cos(d*x+c)^7+8/315*sin(d*x+c)^5/cos(d*x+c)^5)+2*a*b*
(1/7*sin(d*x+c)^3/cos(d*x+c)^7+4/35*sin(d*x+c)^3/cos(d*x+c)^5+8/105*sin(d*x+c)^3/cos(d*x+c)^3)-a^2*(-8/15-1/5*
sec(d*x+c)^4-4/15*sec(d*x+c)^2)*tan(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.19 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (8 \, {\left (21 \, a^{2} - 6 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{8} + 4 \, {\left (21 \, a^{2} - 6 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{6} + 3 \, {\left (21 \, a^{2} - 6 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} + 10 \, {\left (9 \, a b - 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 35 \, b^{2}\right )} \sin \left (d x + c\right )}{315 \, d \cos \left (d x + c\right )^{9}} \]

[In]

integrate(sec(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/315*(8*(21*a^2 - 6*a*b + b^2)*cos(d*x + c)^8 + 4*(21*a^2 - 6*a*b + b^2)*cos(d*x + c)^6 + 3*(21*a^2 - 6*a*b +
 b^2)*cos(d*x + c)^4 + 10*(9*a*b - 5*b^2)*cos(d*x + c)^2 + 35*b^2)*sin(d*x + c)/(d*cos(d*x + c)^9)

Sympy [F]

\[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \sec ^{6}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**6*(a+b*tan(d*x+c)**2)**2,x)

[Out]

Integral((a + b*tan(c + d*x)**2)**2*sec(c + d*x)**6, x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.89 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {35 \, b^{2} \tan \left (d x + c\right )^{9} + 90 \, {\left (a b + b^{2}\right )} \tan \left (d x + c\right )^{7} + 63 \, {\left (a^{2} + 4 \, a b + b^{2}\right )} \tan \left (d x + c\right )^{5} + 210 \, {\left (a^{2} + a b\right )} \tan \left (d x + c\right )^{3} + 315 \, a^{2} \tan \left (d x + c\right )}{315 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

1/315*(35*b^2*tan(d*x + c)^9 + 90*(a*b + b^2)*tan(d*x + c)^7 + 63*(a^2 + 4*a*b + b^2)*tan(d*x + c)^5 + 210*(a^
2 + a*b)*tan(d*x + c)^3 + 315*a^2*tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.71 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.23 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {35 \, b^{2} \tan \left (d x + c\right )^{9} + 90 \, a b \tan \left (d x + c\right )^{7} + 90 \, b^{2} \tan \left (d x + c\right )^{7} + 63 \, a^{2} \tan \left (d x + c\right )^{5} + 252 \, a b \tan \left (d x + c\right )^{5} + 63 \, b^{2} \tan \left (d x + c\right )^{5} + 210 \, a^{2} \tan \left (d x + c\right )^{3} + 210 \, a b \tan \left (d x + c\right )^{3} + 315 \, a^{2} \tan \left (d x + c\right )}{315 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/315*(35*b^2*tan(d*x + c)^9 + 90*a*b*tan(d*x + c)^7 + 90*b^2*tan(d*x + c)^7 + 63*a^2*tan(d*x + c)^5 + 252*a*b
*tan(d*x + c)^5 + 63*b^2*tan(d*x + c)^5 + 210*a^2*tan(d*x + c)^3 + 210*a*b*tan(d*x + c)^3 + 315*a^2*tan(d*x +
c))/d

Mupad [B] (verification not implemented)

Time = 11.49 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.83 \[ \int \sec ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {a^2\,\mathrm {tan}\left (c+d\,x\right )+\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^9}{9}+{\mathrm {tan}\left (c+d\,x\right )}^5\,\left (\frac {a^2}{5}+\frac {4\,a\,b}{5}+\frac {b^2}{5}\right )+\frac {2\,a\,{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (a+b\right )}{3}+\frac {2\,b\,{\mathrm {tan}\left (c+d\,x\right )}^7\,\left (a+b\right )}{7}}{d} \]

[In]

int((a + b*tan(c + d*x)^2)^2/cos(c + d*x)^6,x)

[Out]

(a^2*tan(c + d*x) + (b^2*tan(c + d*x)^9)/9 + tan(c + d*x)^5*((4*a*b)/5 + a^2/5 + b^2/5) + (2*a*tan(c + d*x)^3*
(a + b))/3 + (2*b*tan(c + d*x)^7*(a + b))/7)/d